Skip to contentSkip to conversation

How to use yocto with PXE boot?

DISCUSSION Scott Branden 1 participant 2 messages Jan 23, 2019 – Feb 19, 2019 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

I wish to completely network boot a genericx86-64 image built from yocto.

So far I have been building for core-image-sato and it easily allows booting a live image from a USB device:

https://git.yoctoproject.org/cgit.cgi/poky/plain/meta-yocto-bsp/README.hardware

Are there any instructions to follow on how to PXE (or similar) boot from a yocto build?

I do find pxelinux.0 in build/tmp/sysroots-components/x86_64/syslinux-native/usr/share/syslinux/pxelinux.0 after the build?

Thanks,

Scott

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Hi Jerome,

Quoted 42 lines · Jérôme Carretero

Hi Scott,

Quoted 11 lines · On Wed, 23 Jan 2019 14:19:58 -0800 Scott Branden <[email protected]>…

I wish to completely network boot a genericx86-64 image built from yocto.

So far I have been building for core-image-sato and it easily allows booting a live image from a USB device:

https://git.yoctoproject.org/cgit.cgi/poky/plain/meta-yocto-bsp/README.hardware

Quoted 8 lines

Are there any instructions to follow on how to PXE (or similar) boot from a yocto build?

I do find pxelinux.0 in build/tmp/sysroots-components/x86_64/syslinux-native/usr/share/syslinux/pxelinux.0 after the build?

Getting PXE (I assume you mean non-UEFI, DHCP + TFTP) is the well documented part, it's after the kernel gets loaded and boots that the trouble usually arises.

It took me a few hours to set up a working PXE boot with no initrd and an NFS root, the subtleties were:

- Set the DHCP server to provide NFS v3 mount option (Linux default doesn't boot), with something like (dnsmasq syntax):

    --dhcp-option=17,/srv/nfsroot,tcp,vers=3

If someone told me that, I'd have spent less time with CONFIG_NFS_DEBUG, a serial console and wireshark...

- Some systemd services won't start correctly with a network root... perhaps you don't care about those.

Quoted 7 lines

Other than that, there's the more straightforward things, like the network driver (and perhaps firmware) which should be in-kernel, as well as DHCP client, NFS client and NFS root.

I simply unpacked my rootfs to the NFS served location, but if someone knows a way to build the rootfs directly there it would save some time...

It looks like someone was working on something similar but it never made it into the poky mainline nor was documented?

http://git.yoctoproject.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/nfsroot

Quoted 4 lines

Regards,